#include "clistitem.h"

using namespace cooking;

CListItem::CListItem(QObject* parent):
    CObject(parent)
{
}

int CListItem::listId() {
    return m_list_id;
}

void CListItem::setListId(int listId) {
    if (m_list_id != listId) {
        m_list_id = listId;
        emit listIdChanged();
    }
}

int CListItem::itemId() {
    return m_item_id;
}

void CListItem::setItemId(int itemId) {
    if (m_item_id != itemId) {
        m_item_id = itemId;
        emit itemIdChanged();
    }
}

CListItem::ItemType CListItem::itemType() {
    return m_item_type;
}

void CListItem::setItemType(CListItem::ItemType itemType) {
    if (m_item_type != itemType) {
        m_item_type = itemType;
        emit itemTypeChanged();
    }
}

QString CListItem::name() {
    return m_name;
}

void CListItem::setName(QString name) {
    if (m_name != name) {
        m_name = name;
        emit nameChanged();
    }
}

double CListItem::quantity() {
    return m_quantity;
}

void CListItem::setQuantity(double quantity) {
    if (m_quantity != quantity) {
        m_quantity = quantity;
        emit quantityChanged();
    }
}

double CListItem::purchasedQuantity() {
    return m_purchased_quantity;
}

void CListItem::setPurchasedQuantity(double quantity) {
    if (m_purchased_quantity != quantity) {
        m_purchased_quantity = quantity;
        emit purchasedQuantityChanged();
    }
}

QString CListItem::description() {
    return m_description;
}

void CListItem::setDescription(QString description) {
    if (m_description != description) {
        m_description = description;
        emit descriptionChanged();
    }
}
